﻿@{
    ViewBag.Title = "发起流程";
    Layout = "~/Views/Shared/_Layout_App1.cshtml";
}
@model List<YJ.Data.Model.WorkFlowStart>
    <link href="~/Areas/WeiXin/Scripts/weui.min.css" rel="stylesheet" />
    <link href="~/Areas/WeiXin/Scripts/ext.css" rel="stylesheet" />
    <link href="~/Areas/WeiXin/Scripts/jquery-weui.min.css" rel="stylesheet" />
    <link href="~/Scripts/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
    <style>
        .date {
            color:#999; font-size:12px;
        }
    </style>
    <!-- body 顶部加上如下代码 -->
    <div class="weui-pull-to-refresh__layer">
        <div class='weui-pull-to-refresh__arrow'></div>
        <div class='weui-pull-to-refresh__preloader'></div>
        <div class="down">下拉刷新</div>
        <div class="up">释放刷新</div>
        <div class="refresh">正在刷新</div>
    </div>
    <form id="form1">
    @Html.AntiForgeryToken()
    <div style="padding: 10px;background-color: #f2f2f2;position:relative;">
        <i class="fa fa-search" style="position:absolute;margin: 7px;font-size: 14px;color:#97989d;"></i>
        <input class="ext-input" id="searchkey" name="searchkey" placeholder="输入流程关键字可查询" style="width:calc(100% - 71px);border: 1px solid #d6d9e0;border-radius: 3px;padding-left: 24px;"/>
        <input type="submit" ID="Button1" class="ext-button" value="&nbsp;&nbsp;查询&nbsp;&nbsp;" style="width: 40px;color: #4e7199;border: none;background: none;box-shadow: none;font-size: 14px;"/>
    </div>
    @{
        var flows = Model.GroupBy(p => p.Type).OrderBy(p=>p.Key);
        YJ.Platform.Dictionary bdict = new YJ.Platform.Dictionary();
        foreach(var type in flows)
        {            
     
        <div class="weui-cells__title" style="font-weight:bold;border-top: 1px solid #e3e3e3;margin: 0;padding: .77em 0 .3em 15px;    background-color: #f5f5f5;color: #888;">@type.Key</div>
        <div class="weui-cells">
            
          @foreach (var flow in type.OrderBy(p=>p.Name))
          {
              var address = YJ.Utility.Config.BaseUrl + "/WorkFlowRun/Index_App?flowid=" + flow.ID.ToString() + "&ismobile=1";
     
          <a class="weui-cell weui-cell_access" href="@address">
            <div class="weui-cell__bd">
              <p>@flow.Name</p>
            </div>
            <div class="weui-cell__ft">
            </div>
          </a>
           }
      </div>
        }
        }
    <script src="~/Areas/WeiXin/Scripts/jquery-1.11.1.min.js"></script>
    <script src="~/Areas/WeiXin/Scripts/jquery-weui.min.js"></script>
    <script type="text/javascript">
         $(function ()
         {
             $(document.body).pullToRefresh();
             $(document.body).on("pull-to-refresh", function ()
             {
                 //do something
                 window.location = window.location;
                 $(document.body).pullToRefreshDone();
             });
        });
    </script>
    </form>

